#ifndef _FIG_ENEMY_FORMATIONCRAFT_H_
#define _FIG_ENEMY_FORMATIONCRAFT_H_


#include "fig_enemy_3drotate.h"



class FIGEnemyFormationCraft : public FIGEnemy3DRotate
{
public:

	 enum FORMATION_TYPE
	{
		FORMATION_NONE,
		FORMATION_TRIANGLE,
		FORMATION_LINE,
		
		FORMATION_COUNT
	};

	enum	FORMATION_STATE
	{
		STATE_FORMATION,
		STATE_AIMING_FRONT,
		STATE_DELAY_TIME,
		STATE_SHOOT,
		STATE_TURNINGBACK,
		STATE_GOBACK,
		STATE_DONE,

		STATE_COUNT
	};
	

	FIGEnemyFormationCraft(FIGEnemyCraft::ENEMY_TYPES EnemyType);


	
	virtual void				Tick(float dt);
	virtual void				ReSpawn();
	
	static FORMATION_TYPE		MapNameToType(const std::string& FormationName);
	static std::string			MapTypeToName(FORMATION_TYPE Type);
	void						Setup(FORMATION_TYPE Type, int Index, int MaxCount);
	

protected:

	void						NextState();
	void						Tick_Sway(float dt);

	void						FormLine(int Index, int MaxCount);
	void						FormTriangle(int Index, int MaxCount);


    math::Vec2					M_GoalPos;
	FORMATION_STATE				m_FormationState;
	float						m_RotateBackDegree;
	float						m_RandomSwayDegree;
	bool						m_bSwayPlus;
	bool						m_LastSway;

	float						m_DelayStanding;
	float						m_ExtraOffsetY;

};

#endif
